<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <rich:panel>
        <f:facet name="header">Isemirmalzeme Details</f:facet>
      	
      	<s:decorate id="isemirurun" template="layout/display.xhtml">
            <ui:define name="label">Malzeme</ui:define>
            <h:outputText value="#{isemirmalzemeHome.instance.malzeme.kod}  #{isemirmalzemeHome.instance.malzeme.ad}"/>
        </s:decorate>

        <s:decorate id="makskullanimmiktari" template="layout/display.xhtml">
            <ui:define name="label">Max.Kul.Miktari</ui:define>
            <h:outputText value="#{isemirmalzemeHome.instance.makskullanimmiktari}"/>
        </s:decorate>

        <s:decorate id="miktar" template="layout/display.xhtml">
            <ui:define name="label">Bir Üründeki Miktar</ui:define>
            <h:outputText value="#{isemirmalzemeHome.instance.miktar}"/>
        </s:decorate>

        <div style="clear:both"/>

    </rich:panel>

    <div class="actionButtons">

        <s:button view="/IsemirmalzemeEdit.xhtml"
                    id="edit"
                 value="Edit"/>

        <s:button view="/#{empty isemirmalzemeFrom ? 'IsemirmalzemeList' : isemirmalzemeFrom}.xhtml"
                    id="done"
                 value="Done"/>

    </div>

    <rich:tabPanel switchType="ajax">

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Isemir</h:panelGroup>
        </f:facet>
    <div class="association" id="isemirParent">

        <h:outputText value="There is no isemir associated with this isemirmalzeme."
                   rendered="#{isemirmalzemeHome.instance.isemir == null}"/>

        <rich:dataTable var="_isemir"
                   value="#{isemirmalzemeHome.instance.isemir}"
                rendered="#{isemirmalzemeHome.instance.isemir != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="isemirTable">
		        <h:column>
		            <f:facet name="header">Id</f:facet>
		            <h:outputText value="#{_isemir.id}"/>
		        </h:column>
		        <h:column>
		            <f:facet name="header">Isemirno</f:facet>
		            <h:outputText value="#{_isemir.isemirno}"/>
		        </h:column>
		        <h:column rendered="#{authenticator.isAdmin()}">
		            <f:facet name="header">Firma id</f:facet>
		            <h:outputText value="#{_isemir.firma.ad}"/>
		        </h:column>
		        <h:column>
		            <f:facet name="header">Isemirtarihi</f:facet>
		            <h:outputText value="#{_isemir.isemirtarihi}">
		                <s:convertDateTime type="date" dateStyle="short"/>
		            </h:outputText>
		        </h:column>
		        <h:column>
		            <f:facet name="header">Isletme id</f:facet>
		            <h:outputText value="#{_isemir.isletme.ad}"/>
		        </h:column>
		        <h:column>
		            <f:facet name="header">Siparisno</f:facet>
		            <h:outputText value="#{_isemir.siparisno}"/>
		        </h:column>        
		        <h:column>
		            <f:facet name="header">Urun id</f:facet>
		            <h:outputText value="#{_isemir.urun.urunno} - #{_isemir.urun.adi} ( #{_isemir.urun.kalip.kod} #{_isemir.urun.ambalaj})"/>
		        </h:column>        
		        <h:column>
		            <f:facet name="header">Musteri id</f:facet>
		            <h:outputText value="#{_isemir.musteri.ad}"/>
		        </h:column>
		        <h:column>
		            <f:facet name="header">Planlananadet</f:facet>
		            <h:outputText value="#{_isemir.planlananadet}"/>
		        </h:column>
		        <h:column>
		            <f:facet name="header">Termintarihi</f:facet>
		            <h:outputText value="#{_isemir.termintarihi}">
		                <s:convertDateTime type="date" dateStyle="short"/>
		            </h:outputText>
		        </h:column>
		        <h:column>
		            <f:facet name="header">Ulke id</f:facet>
		            <h:outputText value="#{_isemir.ulke.ad}"/>
		        </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewisemir"
                     value="View"
                      view="/Isemir.xhtml">
                    <f:param name="isemirId"
                           value="#{_isemir.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>

    <rich:tab rendered="#{authenticator.isAdmin()}">
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Isemirharekets</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="isemirhareketsChildren">

        <h:outputText value="There are no isemirharekets associated with this isemirmalzeme."
                   rendered="#{empty isemirmalzemeHome.isemirharekets}"/>

        <rich:dataTable value="#{isemirmalzemeHome.isemirharekets}"
                       var="_isemirhareket"
                  rendered="#{not empty isemirmalzemeHome.isemirharekets}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="isemirhareketsTable">
            <rich:column sortBy="#{_isemirhareket.id}">
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_isemirhareket.id}"/>
            </rich:column>
            <rich:column sortBy="#{_isemirhareket.miktar}">
                <f:facet name="header">Miktar</f:facet>
                <h:outputText value="#{_isemirhareket.miktar}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selectisemirhareket"
                     value="Select"
                      view="/Isemirhareket.xhtml">
                    <f:param name="isemirhareketId"
                            value="#{_isemirhareket.id}"/>
                    <f:param name="isemirhareketFrom" value="Isemirmalzeme"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add isemirhareket"
                view="/IsemirhareketEdit.xhtml">
            <f:param name="isemirmalzemeId"
                    value="#{isemirmalzemeHome.instance.id}"/>
            <f:param name="isemirhareketFrom" value="Isemirmalzeme"/>
        </s:button>
    </div>
    </rich:tab>

</rich:tabPanel>
</ui:define>

</ui:composition>
